namespace DotNetNuke.Security.Authentication
{
    using System;
    using System.Collections;

    public class GroupController
    {
        private string mProviderTypeName = "";

        /// -------------------------------------------------------------------
        /// <summary>
        /// </summary>
        /// <remarks>
        /// </remarks>
        /// <history>
        /// [tamttt]	08/01/2004	Created
        /// </history>
        /// -------------------------------------------------------------------
        public GroupController()
        {
            Configuration _config = Configuration.GetConfig();
            this.mProviderTypeName = _config.ProviderTypeName;
        }

        /// -------------------------------------------------------------------
        /// <summary>
        /// </summary>
        /// <remarks>
        /// </remarks>
        /// <history>
        /// [tamttt]	08/01/2004	Created
        /// </history>
        /// -------------------------------------------------------------------
        public ArrayList GetGroups()
        {
            return AuthenticationProvider.Instance(this.mProviderTypeName).GetGroups();
        }

        /// -------------------------------------------------------------------
        /// <summary>
        /// </summary>
        /// <remarks>
        /// </remarks>
        /// <history>
        /// [tamttt]	08/01/2004	Created
        /// </history>
        /// -------------------------------------------------------------------
        public bool IsAuthenticationMember(GroupInfo AuthenticationGroup, UserInfo AuthenticationUser)
        {
            return AuthenticationProvider.Instance(this.mProviderTypeName).IsAuthenticationMember(AuthenticationGroup, AuthenticationUser);
        }
    }
}

